﻿
IF object_id(N'dbo.[UDS_Document]', 'U') IS NULL
BEGIN
    CREATE TABLE [dbo].[UDS_Document] (
        [DocID]           int           NOT NULL identity(1, 1),
        [ClassID]         int           NOT NULL,
        [DocTitle]        nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL,
        [DocContent]      nvarchar(max) COLLATE Chinese_PRC_CI_AS NULL,
        [DocApprover]     nvarchar(50)  COLLATE Chinese_PRC_CI_AS NULL,
        [DocApproveDate]  datetime      NULL,
        [DocApproved]     bit           NULL CONSTRAINT [DF_UDS_Document_DocApproved] default(((0))),
        [DocLastViewDate] datetime      NULL,
        [DocLastViewer]   nvarchar(50)  COLLATE Chinese_PRC_CI_AS NULL,
        [DocViewedTimes]  int           NOT NULL CONSTRAINT [DF_UDS_Document_DocViewedTimes] default(((0))),
        [DocType]         int           NOT NULL,
        [DocAddedBy]      nvarchar(50)  COLLATE Chinese_PRC_CI_AS NULL,
        [DocAddedDate]    datetime      NULL,
        [DocAttribute]    int           NULL CONSTRAINT [DF_UDS_Document_DocAttribute] default(((0))),
        [DocSign]         int           NULL CONSTRAINT [DF_UDS_Document_DocSign] default((@@spid)),
        [DocDeletion]     bit           NULL CONSTRAINT [DF_UDS_Document_DocDeletion] default(((0)))
    );
END
GO
